
<!DOCTYPE html>
<html>

<head>
   
    
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!--360浏览器优先以webkit内核解析-->


<title>添加模板</title>

<link rel="shortcut icon" href="__STATIC__/layout/favicon.ico">
<link href="__STATIC__/layout/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
<link href="__STATIC__/layout/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
<link href="__STATIC__/layout/css/animate.css" rel="stylesheet">
<link href="__STATIC__/layout/css/style.css?v=4.1.0" rel="stylesheet">
<link href="__STATIC__/layout/css/channel.css?v=4.1.0" rel="stylesheet">
<!-- Sweet Alert -->
<link href="__STATIC__/layout/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
 <link href="__STATIC__/layout/css/plugins/summernote/summernote.css" rel="stylesheet">
    <link href="__STATIC__/layout/css/plugins/summernote/summernote-bs3.css" rel="stylesheet">


    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <style>

        .note-editable {
            height: 150px
        }

    </style>

</head>

<body class="white-bg" style="padding: 3px;font-size: 12px">
    <div class="page-heade">
       <h2 class="title_color text-center">礼品发布</h2>
    </div>
    <form action="" class="form-inline" id="form1">
        <table class="table table-bordered bud_hei text-left">
            <tr>
                <td class="text-left" style="width: 140px;">对应产品<span class="colorRed">*</span>:</td>
                <td class="text-left">
                     <div class="input-group">
                            <input id="area_id" type="text" placeholder="请输入关键字或空格查询"
                                   class="form-control" value="" style="min-width: 300px;width: 300px">
                            <div class="input-group-btn">
                                <ul class="dropdown-menu dropdown-menu-right" role="menu">
                                </ul>
                            </div>
                        </div>
                    </div>
                    <a href="javascript:;" id="select_area" class="btn btn-primary btn-sm">选择</a>
                    (如不选择产品则发布的礼品就是自定义礼品。)
                </td>
            </tr>
            <tr>
                <td class="text-left">礼品名称<span class="colorRed">*</span>:</td>
                <td class="text-left"><input type="text" class="form-control" name="" id=""></td>
            </tr>
            <tr>
                <td colspan="2">
                 <p>产品描述：<span class="colorRed">*</span></p>
                  <div class="ibox float-e-margins" style="margin-bottom: 0">
                        <div class="ibox-content no-padding">

                            <div class="summernote" id="info">
                                                            </div>

                        </div>
                    </div>
                </td>
            </tr>
            <tr>
                <td colspan="2" class="">
                 <p>产品图片：最多上传5张，每张图片不能超过5M。</p>
                 <div class="padding-10"><span class="colorRed">如需上传附件，请点击展开按钮上传</span><button class="btn btn-info btn-sm" id="showhide" type="button">展开</button></div>
                 <div style="height: 160px;width: 98%;display: none;background: #d3ffff" id="shdiv">
                       <div id="uploader" class="wu-example">
                <!--用来存放文件信息-->
                <div id="thelist" class="uploader-list">
                                   </div>
                <div class="btns">
                    <div id="picker">选择文件<input type="file" id="exampleInputFile" name=""></div>
                    <button id="ctlBtn" class="btn btn-default">开始上传</button>
                </div>
                <input type="hidden" name="attach" id="attach"  >
            </div>
            <span>注：最多上传15个文件，每个文件小于50M,支持格式：</span>jpg,bmp,gif,png,jpeg
                 </div>
                </td>
            </tr>
            <tr>
                <td class="text-right">单位<span class="colorRed">*</span></td>
                <td><input type="text" class="form-control" name="" id=""></td>
            </tr>
            <tr>
                <td>所属分类<span class="colorRed">*</span>:</td>
                <td class="text-left">
                    <select name="" id="" class="form-control">
                        <option value="0">常规装</option>
                        <option value="1">促销装</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>兑换上限<span class="colorRed">*</span>：</td>
                <td><input type="text" class="form-control" name="" id=""></td>
            </tr>
            <tr>
                <td colspan="2">
                  <div class="form-group">所需积分<span class="colorRed">*</span>： <input type="text" class="form-control" name="" id="">元</div>
                  <div class="form-group text-center" style="width: 60%;float: right;" >
                      <p>核心经销商：<input type="text" class="form-control" name="" id="" value="">元</p>  
                      <p class="padding-10">二级经销商：<input type="text" class="form-control" name="" id="" value="">元</p>  
                      <p>一级经销商：<input type="text" class="form-control" name="" id="" value="">元</p>  
                      <p class="padding-10">其他：<input type="text" class="form-control" name="" id="" value="">元</p>  
                  </div>
                </td>
            </tr>
           <tr>
                <td>排序编号：</td>
                <td><input type="text" class="form-control" name="" id="" value="999">（排序方式：从小到大，默认为999）</td>
            </tr>
        </table>
     
        <div class="padding-10 text-center"><button class="btn btn-primary" type="submit">保存</button><span class="lr_5"></span><button class="btn btn-warning" type="button" id="fanhui">返回</button></div>
    </form>
  
    
<!-- 全局js -->
<script src="__STATIC__/layout/js/jquery.min.js"></script>
<script src="__STATIC__/layout/js/bootstrap.min.js?v=3.3.6"></script>
<!-- Sweet alert -->
<script src="__STATIC__/layout/js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="__STATIC__/layout/js/plugins/suggest/bootstrap-suggest.min.js"></script>
<script src="__STATIC__/layout/js/plugins/layer/layer.min.js"></script>
<script>
    $(function () {
        $('body').on('click','input[type=text]',function () {
            this.select()
        })
          $('#fanhui').on('click',function () {
//                    parent.layer.close(parent.layer.getFrameIndex(window.name))
                    parent.location.reload();
                    return false
                })
    })
</script>
   <script src="__STATIC__/layout/js/plugins/summernote/summernote.min.js"></script>
<script src="__STATIC__/layout/js/plugins/summernote/summernote-zh-CN.js"></script>

<script>
   
    $(document).ready(function () {
        $('.summernote').summernote({
            lang: 'zh-CN'
        });
    });

  
  var jieshou = $("#area_id");
 sousuo(jieshou);
       function sousuo(id){
            id.bsSuggest({
            allowNoKeyword: false, //是否允许无关键字时请求数据
            multiWord: true, //以分隔符号分割的多关键字支持
            separator: ",", //多关键字支持时的分隔符，默认为空格
            getDataMethod: "url", //获取数据的方式，总是从 URL 获取
            url: 'http://unionsug.baidu.com/su?p=3&t=' + (new Date()).getTime() + '&wd=',
            /*优先从url ajax 请求 json 帮助数据，注意最后一个参数为关键字请求参数*/
            jsonp: 'cb',
            /*如果从 url 获取数据，并且需要跨域，则该参数必须设置*/
            processData: function (json) { // url 获取数据时，对数据的处理，作为 getData 的回调函数
                var i, len, data = {
                    value: []
                };
                if (!json || !json.s || json.s.length === 0) {
                    return false;
                }

                // console.log(json);
                len = json.s.length;

                jsonStr = "{'value':[";
                for (i = 0; i < len; i++) {
                    data.value.push({
                        word: json.s[i]
                    });
                }
                data.defaults = 'baidu';

                //字符串转化为 js 对象
                return data;
            }
        });

          }

$("#showhide").click(function(){
    if($(this).text()=="展开"){
        $("#shdiv").slideDown();
        $(this).text("隐藏")
    }else if($(this).text()=="隐藏"){
         $("#shdiv").slideUp();
          $(this).text("展开")
    }
})
</script>
</body>

</html>